﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CRM.Business_Object;


namespace CRM.CustomerContacts
{
    public partial class CustomerContact : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void ASPxPageControl2_ActiveTabChanged(object source, DevExpress.Web.ASPxTabControl.TabControlEventArgs e)
        {

        }

        protected void ASPxPageControl1_ActiveTabChanged(object source, DevExpress.Web.ASPxTabControl.TabControlEventArgs e)
        {

        }

        protected void btnCreate_Click(object sender, EventArgs e)
        {
            CustomerContactObject customerCon = new CustomerContactObject();
            customerCon.CustomerName = txtCustomerName.Text;
            customerCon.Title = txtTitle.Text;
            customerCon.AccountName = ddlAccountName.SelectedValue;
            customerCon.OfficePhone = Convert.ToInt32(txtOfficePhone.Text);
            customerCon.Mobile = Convert.ToInt32(txtMobile.Text);
            customerCon.Fax = Convert.ToInt32(txtFax.Text);
            customerCon.HomePhone = Convert.ToInt32(txtHomePhone.Text);
            customerCon.AssignedTo = ddlAssignedTo.SelectedValue;
            customerCon.Email = txtEmail.Text;
            customerCon.PrimaryAddress = txtPrimaryAddress.Text;
            customerCon.PrimaryCity = txtPrimaryCity.Text;
            customerCon.PrimaryState = txtPrimaryState.Text;
            customerCon.PrimaryPostalCode = Convert.ToInt32(txtPrimaryPostal.Text);
            customerCon.PrimaryCountry = txtPrimaryCountry.Text;
            customerCon.OtherAdress = txtOtherAddress.Text;
            customerCon.OtherCity = txtOtherCity.Text;
            customerCon.OtherState = txtOtherState.Text;
            customerCon.OtherPostalCode = Convert.ToInt32(txtOtherPostal.Text);
            customerCon.OtherCountry = txtOtherCountry.Text;
        
            CustomerContactObject.createCustomerContacts(customerCon);
        }

        protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            
        }
        
    }
}